Ext.define('AmpleHarvest.objects.groups.window.cGroupMembers',
		{
			extend			: 'Ext.grid.Panel',
			alias			: 'widget.ampleharvest-objects-groups-window-cgroupmembers',
//			id				: 'groupMembersList',
//			alias			: 'widget.membersWindow',
			title			: 'Members',
			requires		:
				[
					'AmpleHarvest.objects.groups.window.members.cToolbar',
					'AmpleHarvest.DATA.Store.cGroupMember'
				],
			layout			: 'fit',
			collapsible		: true,
		    columns			: [
		              	    { header: 'Member',  dataIndex: 'UserName', flex:1},
		              	    { header: 'Status',  dataIndex: 'admin', flex:1}
		              	],

			initComponent		: function()
			{
				var obj_This = this;

				this.store = Ext.create('AmpleHarvest.DATA.Store.cGroupMember');

				this.callParent();
				this.update_store({ id : this.m_str_groupId});
			
				
			},
			
			add_admin_options	: function()
			{
				this.m_obj_Toolbar = Ext
						.create('AmpleHarvest.objects.groups.window.members.cToolbar');

				this.addDocked(this.m_obj_Toolbar, 'top');
			},
			
			setToolbar			: function(obj_View, arr_Selection, obj_Options)
			{
				if (arr_Selection.length < 1)
				{
					return;
				}
				
				this.m_obj_Toolbar.set_Buttons(arr_Selection);
			},
			
			update_store 		: function(options)
			{
				this.store.setOptions(options);
				this.store.load();
			}
		});
